//
//  New_DiscountDetailViewController.m
//  QYer
//
//  Created by lanou on 16/8/16.
//  Copyright © 2016年 CaiZhuYu. All rights reserved.
//

#import "New_DiscountDetailViewController.h"
#import "DestinationDetailViewController.h"
@interface New_DiscountDetailViewController ()

@property (nonatomic, strong) UIWebView *webV;
@end

@implementation New_DiscountDetailViewController


- (void)createWebViewAndSubviews
{
    self.webV = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:kDiscountDealUrl, self.myID]]];
    
    [_webV loadRequest:request];
    
    [self.view addSubview:_webV];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(5, 20, 30, 20)];
    [button setBackgroundImage:[UIImage imageNamed:@"返回"] forState:(UIControlStateNormal)];
    [button addTarget:self action:@selector(clickAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.webV addSubview:button];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, kScreenHeight - 50, kScreenWidth - 100, 50)];
    view.backgroundColor = [UIColor blackColor];
    view.alpha = 0.6;
    [self.webV addSubview:view];
    
    UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(kScreenWidth - 100, kScreenHeight - 50, kScreenWidth - 270, 50)];
    view1.backgroundColor = [UIColor whiteColor];
    [self.webV addSubview:view1];
    
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(60, 10, 100, 30)];
    label.text = @"联系商家";
    label.textColor = [UIColor whiteColor];
    [view addSubview:label];
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 30, 30)];
    imageV.image = [UIImage imageNamed:@"电话"];
    [view addSubview:imageV];
    
    UIButton *button1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 270, 50)];
    button1.backgroundColor = [UIColor redColor];
    [button1 setTitle:@"立即预订" forState:(UIControlStateNormal)];
    [button1 addTarget:self action:@selector(clickAction1) forControlEvents:(UIControlEventTouchUpInside)];
    [view1 addSubview:button1];
}






- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createWebViewAndSubviews];
    
    }


- (void)clickAction
{
    DestinationDetailViewController *destinationVC = [[DestinationDetailViewController alloc] init];
    [self dismissViewControllerAnimated:destinationVC completion:nil];
}



- (void)clickAction1
{
    NSLog(@"立即预订");
}








- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
